﻿#pragma once
#ifndef CLOG_H
#define CLOG_H
#include <QFile>
#include <QDebug>
#include <string>
#include <QDateTime>
class CLog
{
public:
    static CLog* getInstance();
    void writeLog(const char* msg);
    void writeLog(QString msg);
    void writeLog(std::string msg);
private:
    CLog()
    {
        m_pLog = nullptr;
        m_file.setFileName("log.txt");
        if(false == m_file.open(QIODevice::WriteOnly))
            qDebug()<<"create log file fail!\n";
        else
            m_file.close();
    }
    QFile m_file;
    static CLog* m_pLog;
};

#endif // CLOG_H
